# 序列化器
from rest_framework import serializers

from home.models import Banner, Nav


# 轮播图
class BannerModelSerializer(serializers.ModelSerializer):
    class Meta:
        model = Banner
        fields = ("img", "link")


# 导航栏
class NavModelSerializer(serializers.ModelSerializer):
    class Meta:
        model = Nav
        fields = ('title', "link", "position")
